﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using CarFrameWork.Model;

namespace CarFrameWork.UI.ProductDesign._3DModelingDesign.ZhuJianSuQi
{
    public partial class 主齿隔套调整垫圈 : PartFormBase
    {
        CarFrameWork.Model.CanShuHua.主齿隔套调整垫片 zcgttzdq = new CarFrameWork.Model.CanShuHua.主齿隔套调整垫片();
        public 主齿隔套调整垫圈()
        {
            InitializeComponent();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            
            if (TestContent())
            {
                FormToModel();
                zcgttzdq.Add();
            }
            else
            {
                MessageBox.Show("参数不能为空！", "提示");
            }
        }

        private void FormToModel()
        {
            zcgttzdq.ID = 2402216;
            zcgttzdq.name = "主齿隔套调整垫圈";
            zcgttzdq.D1 = Convert.ToSingle(textBox1.Text);
            zcgttzdq.D2 = Convert.ToSingle(textBox2.Text);
            zcgttzdq.B = Convert.ToSingle(textBox3.Text);
        }


        private bool TestContent()
        {
            if (!InspectionText(this.textBox1))
                return false;
            if (!InspectionText(this.textBox2))
                return false;
            if (!InspectionText(this.textBox3))
                return false;
                        return true;
        }
    }
}